package com.cf.timer;

import com.cf.game.service.util.StringUtils;

/**
 * game-server-TimeTask
 *
 * @author <a href="2428922347@qq.com">Zhu mingming</a>
 * @info
 * @since 2018/4/28 下午 03:01
 */
public abstract class ExpirationTask implements Runnable {

    private Integer beatStepSecond;

    private String taskName;

    public ExpirationTask(Integer beatStepSecond) {
        this(beatStepSecond, "");
    }

    public ExpirationTask(Integer beatStepSecond, String taskName) {
        this.beatStepSecond = beatStepSecond;
        if (StringUtils.hasLength(taskName)) {
            this.taskName = taskName;
        } else {
            this.taskName = this.getClass().getName();
        }
    }

    public abstract String getTaskDispatchId();

    public Integer getBeatStepSecond() {
        return beatStepSecond;
    }

    public void setBeatStepSecond(Integer beatStepSecond) {
        this.beatStepSecond = beatStepSecond;
    }

    public String getTaskName() {
        return taskName;
    }

    public void setTaskName(String taskName) {
        this.taskName = taskName;
    }
}
